syslinux: Adapt to bootloader UI changes
authorMatthew Barnes <mbarnes@redhat.com>
Mon, 10 Nov 2014 00:54:37 +0000 (19:54 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Tue, 11 Nov 2014 02:31:32 +0000 (21:31 -0500)
This was a side-effect of the bootloader UI changes in bug 739416,
but should now be sufficiently future-proofed with code comments.

src/libostree/ostree-bootloader-syslinux.c
src/libostree/ostree-sysroot-deploy.c

index 86b66fa2bf05aaa0817e417677a346e8af14829d..6c2b441735d0bc0e27b1cdc289c3ad4764d6416a 100644 (file)
@@ -206,8 +206,14 @@ _ostree_bootloader_syslinux_write_config (OstreeBootloader          *bootloader,
                (g_str_has_prefix (line, "DEFAULT ")))
         {
           saw_default = TRUE;
-          if (g_str_has_prefix (line, "DEFAULT ostree:"))
-            regenerate_default = TRUE;
+          /* XXX Searching for patterns in the title is rather brittle,
+           *     but this hack is at least noted in the code that builds
+           *     the title to hopefully avoid regressions. */
+          if (g_str_has_prefix (line, "DEFAULT ostree:") ||  /* old format */
+              strstr (line, "(ostree") != NULL)              /* new format */
+            {
+              regenerate_default = TRUE;
+            }
           skip = TRUE;
         }
       
index 1ebae77ec78a54f3366258873e71cc5a68565e88..5cf4b2bcc116a80f16525cdf74abb64eaf8ce4fd 100644 (file)
@@ -1365,6 +1365,9 @@ install_deployment_kernel (OstreeSysroot   *sysroot,
         }
     }
 
+  /* XXX The SYSLINUX bootloader backend actually parses the title string
+   *     (specifically, it looks for the substring "(ostree"), so further
+   *     changes to the title format may require updating that backend. */
   title_key = g_string_new (val);
   if (deployment_version && *deployment_version)
     {